
import processing.core.PImage;

/**
 *
 * @author admindev
 */
public class Soldier extends Player
{
    public PImage image;
            
    float beginX = (float) 50.0;  // Initial x-coordinate
    float beginY = (float) 250.0;  // Initial y-coordinate
    float endX = (float) 1150.0;   // Final x-coordinate
    float endY = (float) 120.0;   // Final y-coordinate
    float distX;          // X-axis distance to move
    float distY;          // Y-axis distance to move
    float exponent = 4;   // Determines the curve
    float step = (float) 0.01;    // Size of each step along the path
    float pct = (float) 0.0;      // Percentage traveled (0.0 to 1.0)

    public Soldier(PImage image, Jeu program)
    {
        super(program);
        this.image = image;
    }

    public void move()
    {
        setDistX(endX - beginX);
        setDistY(endY - beginY);
    }

    public void create()
    {
            program.fill(0, 2);
            pct += step;
            float x = beginX + (pct * distX);
            float y = beginY + (program.pow(pct, exponent) * distY);
            program.fill(255);
            program.image(image,x, y);
            
            //Player.addQuantitySoldiers();
    }
    
///////////////////////////////////////////////////////////////////////
///////                    Getter/ Setter                       /////// 
///////////////////////////////////////////////////////////////////////
    
    public float getDistX()
    {
        return distX;
    }

    public void setDistX(float distX)
    {
        this.distX = distX;
    }

    public float getDistY()
    {
        return distY;
    }

    public void setDistY(float distY)
    {
        this.distY = distY;
    }

}
